import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

import Layout from '@/views/layout/Layout'

  export const constCommonRouter = [
    {
      path: '/login',
      name: 'login',
      hidden: true,
      component: ()=> import('@/views/auth/login'),
      meta: {
        icon: '',
        title: '登录'
      }
    },
    {
      path: '/register',
      name: 'register',
      hidden: true,
      component: ()=> import('@/views/auth/register'),
      meta: {
        icon: '',
        title: '注册'
      }
    },
    {
      path: '',
      component: Layout,
      redirect: 'index',
      children: [
        {
          path: 'index',
          component: ()=> import('@/views/index/index'),
          name: 'Index',
          meta: {icon: 'el-icon-s-home', title: '主页'}
        }
      ]
    },
    {
      path: '/user',
      component: Layout,
      hidden: true,
      redirect: 'index',
      children: [
        {
          path: 'home',
          component: ()=> import('@/views/user/home'),
          name: 'home',
          meta: {icon: '', title: '个人中心'}
        }
      ]
    }
]

export default new Router({
  mode: 'history',
  // linkActiveClass: 'active',
  routes: constCommonRouter

})
